<template>
  <div>
    <van-nav-bar
      title="服务协议"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
    />
    <div class="text-agree" v-html="state.htmlText"></div>
  </div>
</template>

<script setup lang="ts">
import { getPolicy } from "@/api/user.ts";
import { showToast } from "vant";
import { reactive } from "vue";
const onClickLeft = () => history.back();
const state = reactive({
  htmlText: "",
});
const getPolicyChange = async() => {
  const res = await getPolicy({
    id: 17,
  });
  if (res) {
    state.htmlText = res.records[0].content;
  } else {
    showToast(res.msg);
  }
}
getPolicyChange();
</script>

<style lang="scss" scoped>
.text-agree{
  padding: .5px .7px;
}
</style>
